package com.ruoyi.point.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.math.BigDecimal;
import java.util.Date;
import com.ruoyi.point.domain.Users;

/**
 * 积分兑换订单对象 exchange_order
 * 
 * @author hy
 * @date 2025-08-12
 */
public class ExchangeOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 订单ID */
    private Long id;

    /** 订单编号（如EX202401150001） */
    @Excel(name = "订单编号", readConverterExp = "如=EX202401150001")
    private String orderSn;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Long userId;

    /** 商品ID */
    @Excel(name = "商品ID")
    private Long goodsId;

    /** 商品名称（冗余） */
    @Excel(name = "商品名称", readConverterExp = "冗=余")
    private String goodsName;

    /** 消耗积分 */
    @Excel(name = "消耗积分")
    private Long point;

    /** 收货地址ID（实物商品必填） */
    @Excel(name = "收货地址ID", readConverterExp = "实=物商品必填")
    private Long addressId;

    /** 订单状态：0-处理中，1-已发货，2-已完成 */
    @Excel(name = "订单状态：0-处理中，1-已发货，2-已完成")
    private Integer status;

    /** 是否删除：0正常 1删除 */
    @Excel(name = "是否删除：0正常 1删除")
    private Integer del;

    // 多表联查关联的实体类
    /** 关联的商品信息 */
    private MallGoods mallGoods;

    /** 关联的用户信息 */
    private Users users;

    /** 关联的地址信息 */
    private UserAddress userAddress;

    /** 关联的物流信息 */
    private Logistics logistics;

    /**
     * 设置默认状态为处理中
     */
    public void setDefaultStatus() {
        this.status = 0;
    }

    /**
     * 更新订单状态为已发货
     */
    public void setShippedStatus() {
        this.status = 1;
    }

    /**
     * 更新订单状态为已完成
     */
    public void setCompletedStatus() {
        this.status = 2;
    }

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setOrderSn(String orderSn) 
    {
        this.orderSn = orderSn;
    }

    public String getOrderSn() 
    {
        return orderSn;
    }

    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }

    public void setGoodsId(Long goodsId) 
    {
        this.goodsId = goodsId;
    }

    public Long getGoodsId() 
    {
        return goodsId;
    }

    public void setGoodsName(String goodsName) 
    {
        this.goodsName = goodsName;
    }

    public String getGoodsName() 
    {
        return goodsName;
    }

    public void setPoint(Long point) 
    {
        this.point = point;
    }

    public Long getPoint() 
    {
        return point;
    }

    public void setAddressId(Long addressId) 
    {
        this.addressId = addressId;
    }

    public Long getAddressId() 
    {
        return addressId;
    }

    public void setStatus(Integer status) 
    {
        this.status = status;
    }

    public Integer getStatus() 
    {
        return status;
    }

    public void setDel(Integer del) 
    {
        this.del = del;
    }

    public Integer getDel() 
    {
        return del;
    }

    // 关联实体类的getter和setter
    public MallGoods getMallGoods() {
        return mallGoods;
    }

    public void setMallGoods(MallGoods mallGoods) {
        this.mallGoods = mallGoods;
    }

    public Users getUsers() {
        return users;
    }

    public void setUsers(Users users) {
        this.users = users;
    }

    public UserAddress getUserAddress() {
        return userAddress;
    }

    public void setUserAddress(UserAddress userAddress) {
        this.userAddress = userAddress;
    }

    public Logistics getLogistics() {
        return logistics;
    }

    public void setLogistics(Logistics logistics) {
        this.logistics = logistics;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("orderSn", getOrderSn())
            .append("userId", getUserId())
            .append("goodsId", getGoodsId())
            .append("goodsName", getGoodsName())
            .append("point", getPoint())
            .append("addressId", getAddressId())
            .append("status", getStatus())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("del", getDel())
            .toString();
    }
}
